package com.ddwl.order.dao;

import com.ddwl.common.dao.TkDao;
import com.ddwl.order.dao.mapper.SecondKillOrderMapper;
import com.ddwl.order.dao.model.SecondKillOrder;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class SecondKillOrderDao  extends TkDao<SecondKillOrderMapper, SecondKillOrder> {



    public List<SecondKillOrder> getByIdAndkillIdAndBarCode(String userId, String killId, String barCode){
        SecondKillOrder killOrder = new SecondKillOrder();
        killOrder.setUserId(userId);
        killOrder.setSeckillId(killId);
        killOrder.setSeckillSkuCode(barCode);
        return select(killOrder);
    }

    public SecondKillOrder getByOrderId(String orderId){
        SecondKillOrder killOrder = new SecondKillOrder();
        killOrder.setOrderNo(orderId);
        return selectOne(killOrder);
    }
}
